package com.xie.o2o.dto;

import com.xie.o2o.entity.Product;
import com.xie.o2o.enums.ProductStateEnum;

import java.util.List;

/**
 * @create: xie
 */
public class ProductExecution {

    //结果状态
    private int state;
    //状态标识
    private String stateInfo;
    //操作的product(增删改时使用)
    private Product product;
    //获取的product列表(查询商品列表时使用)
    private List<Product> productList;
    //获取的product总数(查询商品列表时使用)
    private int productCount;

    public ProductExecution() {
    }
    //失败的构造器
    public ProductExecution(ProductStateEnum productStateEnum) {
        this.state = productStateEnum.getState();
        this.stateInfo = productStateEnum.getStateInfo();
    }

    //成功的构造器
    public ProductExecution(ProductStateEnum productStateEnum, Product product) {
        this.state = productStateEnum.getState();
        this.stateInfo = productStateEnum.getStateInfo();
        this.product = product;
    }

    //成功的构造器
    public ProductExecution(ProductStateEnum productStateEnum, List<Product> productList) {
        this.state = productStateEnum.getState();
        this.stateInfo = productStateEnum.getStateInfo();
        this.productList = productList;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public List<Product> getProductList() {
        return productList;
    }

    public void setProductList(List<Product> productList) {
        this.productList = productList;
    }

    public int getProductCount() {
        return productCount;
    }

    public void setProductCount(int productCount) {
        this.productCount = productCount;
    }
}
